package de.uni_mannheim.informatik.ai.dame_ai.util;

import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * A modal Popup Dialog tah displays a message to the user.
 * @author Martin Boelle
 *
 */
@SuppressWarnings("serial")
public class MessageDialog extends PopupDialog {

	/**
	 * 
	 * @param owner The owner of the dialog. He will be disabled until the user responds.
	 * @param title The title for the dialog frame.
	 * @param text The text message that should be diplayed to the user.
	 */
	public MessageDialog(Window owner, String title, String text) {
		super(owner, title, text);
		JButton oKBut=new MinSizeButton("OK", MIN_BUTTON_WIDTH);
		butPan.add(oKBut);
		oKBut.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		setVisible(true);
	}
}
